import Vue from 'vue'
import Router from 'vue-router'

// Containers
import Full from '@/containers/Full'

// 首页
import Homepage from '@/views/Homepage'

// 登录
import Login from '@/views/Login'

// Views - Components
// import Nclassify from '@/views/Components/Switches'
// import Ndetail from '@/views/Components/Forms'
// import Pdetail from '@/views/Components/Modals'
// import rfi from '@/views/Components/Buttons'
// import Pclassify from '@/views/Components/Modals'

// views - 信息管理
import Consult from '@/views/Information/Consult'
import Consultdetail from '@/views/Information/ConsultDetail'
import Rfi from '@/views/Information/Rfi'
import Rfidetail from '@/views/Information/RfiDetail'
import Quote from '@/views/Information/RfiQuote'

// views -系统管理
import UpdatePw from '@/views/UpdatePw'

// views - 新闻管理
import News from '@/views/News'
import Newslist from '@/views/NewsList'
// views - 展会信息
import Exhibition from '@/views/News/Exhibition'
import ExhibitionDetail from '@/views/News/ExhibitionDetail'

// views - 产品管理
import Product from '@/views/Product/Product'
import ProDetailEdit from '@/views/Product/ProDetailEdit'
import ProAdd from '@/views/Product/AddProduct'
import ProClassify from '@/views/Product/ProClassify'
import ProClassifyDetail from '@/views/Product/ProClassifyDetail'
import ProClaAddGoodsId from '@/views/Product/ProClaAddGoodsId'
import ProClaThree from '@/views/Product/ProClaThree'

// views - 解决方案
import SolClassify from '@/views/Solution/SolClassify'
import SolList from '@/views/Solution/SolList'
import ScEditDetail from '@/views/Solution/SolClassifyEditDetail'
import SlEditDetail from '@/views/Solution/SolListEditDetail'

Vue.use(Router)

export default new Router({
  mode: 'hash', // Demo is living in GitHub.io, so required!
  linkActiveClass: 'open active',
  scrollBehavior: () => ({ y: 0 }),
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/',
      redirect: '/login',
      name: '系统首页',
      component: Full,
      children: [
        {
          path: 'homepage',
          name: '系统概况',
          component: Homepage
        },
        {
          path: 'news',
          name: '新闻管理',
          redirect: '/news/news_list',
          component: {
            render (c) { return c('router-view') }
          },
          children: [
            {
              path: 'news_list',
              name: '新闻列表',
              component: Newslist
            },
            {
              path: 'news_detail',
              name: '新闻内容',
              component: News
            },
            {
              path: 'exhibition',
              name: '展会信息',
              component: Exhibition
            },
            {
              path: 'e_detail',
              name: '展会详情',
              component: ExhibitionDetail
            }
          ]
        },
        {
          path: 'product',
          name: '产品管理',
          redirect: '/product/p_classify',
          component: {
            render (c) { return c('router-view') }
          },
          children: [
            {
              path: 'p_detail',
              name: '产品详细',
              component: Product
            },
            {
              path: 'p_d_edit',
              name: '产品详情/编辑',
              component: ProDetailEdit
            },
            {
              path: 'p_add',
              name: '产品添加',
              component: ProAdd
            },
            {
              path: 'p_classify',
              name: '产品分类',
              component: ProClassify
            },
            {
              path: 'p_c_detail',
              name: '二级分类',
              component: ProClassifyDetail
            },
            {
              path: 'p_goodsid',
              name: '添加GoodsId',
              component: ProClaAddGoodsId
            },
            {
              path: 'p_c_three',
              name: '产品',
              component: ProClaThree
            }
          ]
        },
        {
          path: 'information',
          redirect: '/information/rfi',
          name: '信息管理',
          component: {
            render (c) { return c('router-view') }
          },
          children: [
            {
              path: 'rfi',
              name: 'RFI信息',
              component: Rfi
            },
            {
              path: 'consult',
              name: '咨询信息',
              component: Consult
            },
            {
              path: 'rfi_detail',
              name: 'RFI信息详情',
              component: Rfidetail
            },
            {
              path: 'rfi_quote',
              name: 'RFI报价详情',
              component: Quote
            },
            {
              path: 'consult_detail',
              name: '咨询信息详情',
              component: Consultdetail
            }
          ]
        },
        {
          path: 'solution',
          redirect: '/solution/s_classify',
          name: '解决方案',
          component: {
            render (c) { return c('router-view') }
          },
          children: [
            {
              path: 's_classify',
              name: '方案分类',
              component: SolClassify
            },
            {
              path: 's_c_editDetail',
              name: '详情编辑',
              component: ScEditDetail
            },
            {
              path: 's_list',
              name: '方案列表',
              component: SolList
            },
            {
              path: 's_l_editDetail',
              name: '方案详情编辑',
              component: SlEditDetail
            }
          ]
        },
        {
          path: 'system',
          redirect: '/system/update_pw',
          name: '系统管理',
          component: {
            render (c) { return c('router-view') }
          },
          children: [
            {
              path: 'update_pw',
              name: '账号管理',
              component: UpdatePw
            }
          ]
        }
      ]
    }
  ]
})
